import { defHttp } from '@/utils/http/axios';
import { IOrderSettlement, IOrderSettlementDetail } from './type';
import { BasicFetchResult } from '@/api/model/baseModel';

enum Api {
  getOrderSettlement = '/mall/op/order/settleList',
  getOrderSettlementDtail = '/mall/op/order/settleDetail'
}

/**
 * 查询结算订单列表
 * @param params 
 * @returns 
 */
export function getOrderSettlement(params) {
  return defHttp.get<BasicFetchResult<IOrderSettlement>>({
    url: Api.getOrderSettlement,
    params,
  });
}

/**
 * 结算详情
 * @param id 
 * @returns 
 */
export function getOrderSettlementDtail(id: number) {
  return defHttp.get<IOrderSettlementDetail>({
    url: Api.getOrderSettlementDtail + '/' + id,
  });
}
